home *** CD-ROM | disk | FTP | other *** search
/ Visual Cafe 3 / Visual Cafe 3.ISO / Vcafe / Main.bin / Transferable.java < prev    next >
Text File  |  1998-09-22  |  2KB  |  59 lines

  1. /*
  2.  * @(#)Transferable.java    1.4 98/07/01
  3.  *
  4.  * Copyright 1995-1998 by Sun Microsystems, Inc.,
  5.  * 901 San Antonio Road, Palo Alto, California, 94303, U.S.A.
  6.  * All rights reserved.
  7.  * 
  8.  * This software is the confidential and proprietary information
  9.  * of Sun Microsystems, Inc. ("Confidential Information").  You
  10.  * shall not disclose such Confidential Information and shall use
  11.  * it only in accordance with the terms of the license agreement
  12.  * you entered into with Sun.
  13.  */
  14.  
  15. package java.awt.datatransfer;
  16.  
  17. import java.io.IOException;
  18.  
  19. /**
  20.  * Defines the interface for classes that can be used to provide data
  21.  * for a transfer operation.
  22.  *
  23.  * @version     1.4, 07/01/98
  24.  * @author    Amy Fowler  
  25.  */
  26.  
  27. public interface Transferable {
  28.  
  29.     /**
  30.      * Returns an array of DataFlavor objects indicating the flavors the data 
  31.      * can be provided in.  The array should be ordered according to preference
  32.      * for providing the data (from most richly descriptive to least descriptive).
  33.      * @return an array of data flavors in which this data can be transferred
  34.      */
  35.     public DataFlavor[] getTransferDataFlavors();
  36.  
  37.     /**
  38.      * Returns whether or not the specified data flavor is supported for
  39.      * this object.
  40.      * @param flavor the requested flavor for the data
  41.      * @return boolean indicating wjether or not the data flavor is supported
  42.      */
  43.     public boolean isDataFlavorSupported(DataFlavor flavor);
  44.  
  45.     /**
  46.      * Returns an object which represents the data to be transferred.  The class 
  47.      * of the object returned is defined by the representation class of the flavor.
  48.      *
  49.      * @param flavor the requested flavor for the data
  50.      * @see DataFlavor#getRepresentationClass
  51.      * @exception IOException                if the data is no longer available
  52.      *              in the requested flavor.
  53.      * @exception UnsupportedFlavorException if the requested data flavor is
  54.      *              not supported.
  55.      */
  56.     public Object getTransferData(DataFlavor flavor) throws UnsupportedFlavorException, IOException;
  57.  
  58. }
  59.